package org.mindrive.system.util;

import java.util.Map;

public final class ParameterCheck {

	public static final void mandatory(final String strParamName, final Object object) {
		if (object == null) {
			throw new IllegalArgumentException(strParamName + "是必须输入的参数");
		}
	}

	public static final void mandatoryString(final String strParamName, final String strParamValue) {

		if (strParamValue == null || strParamValue.length() == 0 || "".equals(strParamValue)
				|| "".equals(strParamValue.trim())) {
			throw new IllegalArgumentException(strParamName + "是必须输入的参数");
		}
	}

	public static final void mandatoryCheck(String title, String propertyName, Map<String, Object> properties) {
		Object value = properties.get(propertyName);
		if (value == null) {
			throw new IllegalArgumentException(title + "是必须输入");
		}
	}
}
